﻿using QG.FrontDesk.BLL.IService;
using QG.FrontDesk.DAL.IRepository;
using QG.FrontDesk.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QG.FrontDesk.BLL.Service
{
    public class PositionInfoService : IPositionInfoService
    {
        private IPositionInfoRepository _positionInfoRepository;

        public PositionInfoService(IPositionInfoRepository positionInfoRepository)
        {
            _positionInfoRepository = positionInfoRepository;
        }
        /// <summary>
        /// 得到对应的职位信息
        /// </summary>
        /// <param name="CompId"></param>
        /// <param name="statu"></param>
        /// <returns></returns>
        public List<PositionInfo> GetPosition(int CompId, bool statu)
        {
            return _positionInfoRepository.GetPosition(CompId,statu);
        }

        /// <summary>
        /// 得到职位信息
        /// </summary>
        /// <returns></returns>
        public List<PositionInfo> GetPositionInfos(string type, string word,Nullable<int> ClassId, Nullable<int> level)
        {
            return _positionInfoRepository.GetPositionInfos(type,word,ClassId,level);
        }
        /// <summary>
        /// 更改职位状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="statu"></param>
        /// <returns></returns>
        public int UpdatePositionStatu(int id, bool statu)
        {
            return _positionInfoRepository.UpdatePositionStatu(id,statu);
        }
    }
}
